package com.trkj.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.util.Scanner;

@Aspect
@Component
public class MessageAspect {
    private Scanner scanner = new Scanner(System.in);

    @Before("execution(* com.trkj.service.impt.phoneService.sendMessage(..))")
    public void beforeSendMessage() {
        // 输入收信号码逻辑
        System.out.println("请输入收信号码：");
        String receiver = scanner.nextLine();

        // 输入信息内容逻辑
        System.out.println("请输入信息内容：");
        String content = scanner.nextLine();

        // 输出收信号码和信息内容
        System.out.println("收信号码：" + receiver);
        System.out.println("信息内容：" + content);
    }
}